/*
 * 魔术师猜数（4分）
 */

#include <stdio.h>

int Magic(int m) {
	for (int a = 0; a < 10; ++a) {
		for (int b = 0; b < 10; ++b) {
			for (int c = 0; c < 10; ++c) {
				if (a * 100 + c * 10 + b +
				    b * 100 + a * 10 + c +
				    b * 100 + c * 10 + a +
				    c * 100 + a * 10 + b +
				    c * 100 + b * 10 + a == m) {
					printf("The number is %d\n", a * 100 + b * 10 + c);
					return 1;
				}
			}
		}
	}

	return 0;
}

int main() {
	setbuf(stdout, NULL);

	int input_sum;

	scanf("%d", &input_sum);

	if (Magic(input_sum) == 0) {
		printf("The sum you calculated is wrong!\n");
	}

	return 0;
}
